<!DOCTYPE html>
<html>
	<head>
		<include file="./Public/Header/header.html,./Public/Header/jquery.html,./Public/Header/mobile.html,./Public/Header/validate.html" />
		<title>兑奖页面</title>
	</head>
<body>
<div id="awardpage" data-role="page" data-theme="c">
	<include file="Public/mobile_header" header="兑奖页面"/>
	<div data-role="content">
		<form id="awardform" method="post" action="{:U('Scratch/Scratch/awardHandle')}">
			<div data-role="fieldcontain">
  			<label for="sncode">兑奖sncode:</label>
  			<input type="text" name="sncode" id="sncode"  placeholder="请输入您的兑奖sncode">
  			</div>
  			<div data-role="fieldcontain">
  			<label for="qq">QQ号码：</label>
  			<input type="number" name="qq" id="qq"  placeholder="请输入您的密码">
  			</div>
  			<input type="submit" value="兑奖" name="awardbtn" id="awardbtn" data-theme="e">
		</form>
	</div>
</div>
<script>
$('#awardpage').bind('pageinit', function(event) {
	$('#awardform').validate({
		submitHandler:function(form) {
			form.submit();
		},
		errorPlacement: function(error, element) {  
		    error.appendTo(element.parent().parent());  
		},
		onfocusout: function(element) { $(element).valid();},
		rules: {
			sncode: {
				required: true,
				remote:"{:U('Scratch/Scratch/awardHandle')}",
			},
			qq: {
				required: true
			}
		},
		 messages:  {
		sncode: {
			required:"请输入您的兑奖sncode",
			remote:"您输入的sncode有误，请核对！"
		},
		qq: {
			required:"请输入您的QQ号码"
		}
		}	
	});
});
</script>
</body>
</html>